package com.hadwinling.service;

import com.hadwinling.entity.NuclearParam;
import org.apache.iotdb.rpc.IoTDBConnectionException;
import org.apache.iotdb.rpc.StatementExecutionException;
import org.apache.iotdb.tsfile.read.common.Field;
import org.apache.iotdb.tsfile.read.common.RowRecord;

import java.util.ArrayList;
import java.util.List;

/**
 * @Classname RealTimeService
 * @Description TODO
 * @Date 2021/7/9 14:48
 * @Created by
 */
public interface RealTimeService {

    /**
     * 模拟实时插入数据
     *
     * @param storage    要插入到的存储组
     * @param zujianNum  组件数量
     * @param zhibiaoNum 指标数量
     */
    void realTimeInsertion(String storage, int zujianNum, int zhibiaoNum) throws StatementExecutionException, IoTDBConnectionException;


    void realTimeInsertionWithSchedule(String storage);


    void realTimeInsertionWithSleep(String storage) throws InterruptedException;
    /**
     * 1 .燃耗步 物理场 时间 4D
     * @param nuclearParam 指标
     * @return 组件 和层
     * @throws StatementExecutionException
     * @throws IoTDBConnectionException
     */
    ArrayList<RowRecord> selectTheLastestTimeWithIndicatorReturnModule(NuclearParam nuclearParam) throws StatementExecutionException, IoTDBConnectionException;


    /**
     * 查找最近第几个 数据
     * @param nuclearParam 指标
     * @return
     */
    ArrayList<RowRecord> selectTheLastestNoTimeWithIndicatorReturnModule(NuclearParam nuclearParam) throws StatementExecutionException, IoTDBConnectionException;


    /**
     * 2 .燃耗步 物理场 时间
     * @return 返回 层和组件
     */
    ArrayList<List<Field>> selectTheLatestTimeWithReturnLayerAndModule(NuclearParam nuclearParam) throws StatementExecutionException, IoTDBConnectionException;

    /**
     * 3. 燃耗步 物理场 组件
     * @param nuclearParam 指标
     * @return 层 和时刻
     */
    ArrayList<List<Field>> selectTheLatestTimeWithReturnLayerAndTime(NuclearParam nuclearParam) throws StatementExecutionException, IoTDBConnectionException;

    /**
     * 4 时刻 组件 物理场
     * @param nuclearParam 物理场 组件
     * @return 层 和 燃耗步
     * @throws StatementExecutionException
     * @throws IoTDBConnectionException
     */
    ArrayList<List<Field>> selectTheLatestTimeWithReturnLayerAndBurn(NuclearParam nuclearParam) throws StatementExecutionException, IoTDBConnectionException;


    /**
     * 6. 组件 层 物理场2d
     * @param nuclearParam  物理场， 时刻
     * @return
     */
    ArrayList<List<Field>> select_Module_layer_Indicator_With_Return_time(NuclearParam nuclearParam) throws StatementExecutionException, IoTDBConnectionException;

    /**
     * 2.1 plot_burn_ind_mod (burn,indicator,module)
     *
     * @param nuclearParam 传过来的值
     * @return
     */
    ArrayList<List<Field>> plot_burn_indicator_module_real_time(NuclearParam nuclearParam) throws StatementExecutionException, IoTDBConnectionException;

}
